/* ---------------------------------------------------------------------------
 * This software is in the public domain, furnished "as is", without technical
 * support, and with no warranty, express or implied, as to its usefulness for
 * any purpose.
 *
 * Debug.h
 *
 * Author: Guillaume Boissé
 * -------------------------------------------------------------------------*/

#ifndef _JSP_DEBUG_H
#define _JSP_DEBUG_H

#ifdef DEBUG
#   ifdef WIN32
#       include <intrin.h>
#   endif // WIN32

#   define DEBUGBREAK __debugbreak()

#   define ASSERT(x) \
        do \
        { \
            if (!(x)) \
            { \
                DEBUGBREAK; \
            } \
        } \
        while (0)
#else
#   define ASSERT(x) \
        do \
        { \
            (void) sizeof(x); \
        } \
        while (0)
#endif // DEBUG

#endif // _JSP_DEBUG_H
